import dva from 'dva';
import './index.css';

import createHistory from 'history/createBrowserHistory';
import createLoading from 'dva-loading';
import models from './models'

// 1. Initialize
const app = dva({
    history: createHistory(),
});

// 2. Plugins
app.use(createLoading());

// 加载所有model
models.forEach(model => {
    app.model(model.default)
});

// 4. Router
app.router(require('./router').default);

// 5. Start
app.start('#root');
